package model;


import java.util.Date;

import com.j256.ormlite.dao.ForeignCollection;
import com.j256.ormlite.field.DataType;
import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.field.ForeignCollectionField;
import com.j256.ormlite.table.DatabaseTable;

@DatabaseTable(tableName = "consumos_diarios")
public class ConsumoDiario {
	public static final String ID_FIELD_NAME = "id"; 
	public static final String FECHA_DIARIA_FIELD_NAME = "fecha_diaria"; 
	public static final String REGIMEN_ALIMENTICIO_FIELD_NAME = "regimen_alimenticio_id"; 
	public static final String FK_CONSUMO_FIELD_NAME = "consumo_diario_id"; 
	
	@DatabaseField(generatedId=true,columnName=ID_FIELD_NAME )
	private int id;
	
	@DatabaseField(dataType = DataType.DATE_LONG,columnName=FECHA_DIARIA_FIELD_NAME) //Se guarda la fecha como LONG para facilitar busqueda
	private Date dia;
	
	@ForeignCollectionField(eager = false)
    ForeignCollection<Consumo> consumos;
	
	@DatabaseField(foreign=true, columnName=REGIMEN_ALIMENTICIO_FIELD_NAME)
	private RegimenAlimenticio puedoConsumir;

	
	public ConsumoDiario() {
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public ForeignCollection<Consumo> getConsumos() {
		return consumos;
	}

	public void setConsumos(ForeignCollection<Consumo> consumos) {
		this.consumos = consumos;
	}

	public Date getDia() {
		return dia;
	}

	public void setDia(Date dia) {
		this.dia = dia;
	}

	public RegimenAlimenticio getPuedoConsumir() {
		return puedoConsumir;
	}

	public void setPuedoConsumir(RegimenAlimenticio puedoConsumir) {
		this.puedoConsumir = puedoConsumir;
	}
	
		
	
	
}
